cd "/Users/TJRyan/Library/CloudStorage/Dropbox/2022 Primary Survey/Personal funds experiment/Replication files"

**# Table 2
use "workingdata.dta", clear
reg electability_dif cand1_money personalmoney 
reg electability_dif cand1_money personalmoney if pid3==1
reg electability_dif cand1_money personalmoney if pid3==2
reg electability_dif cand1_money personalmoney if pid3==3

**# Table 3
use "workingdata.dta", clear
reg electability_dif cand1_money percent_self 
reg electability_dif cand1_money percent_self if pid3==1
reg electability_dif cand1_money percent_self if pid3==2
reg electability_dif cand1_money percent_self if pid3==3


**# Table 4
use "News Article Content.dta", clear

**# Drop Observations that are not relevant
drop if notrelevant==1
drop if primary==0

**# Number of races that talk about fund raising
tab fundraising

/* Only using races that are Senate races where at least 1 candidate self-funded at least $1M (Source: 

https://www.opensecrets.org/elections-overview/top-self-funders?cycle=2022)

Durant (4) + Blanchard (1) (AL-R)
Lamon (18) McGuire (1) (AZ-R)
Fenton (1) (NH-R)
Gibbons (18) + Dolan (10M)+ Timken (4) + Moreno (3) (OH-R) 
Mehmet Oz (26) + McCormick (14) + Sands (4) (PA-R) 
Lasry (14) (WI-D)
*/

keep if race=="US SENATE" | race=="US Senate"
keep if stateparty=="AL-R" | stateparty=="AZ-R" | stateparty=="NH-R" | stateparty=="OH-R" | stateparty=="PA-R" | stateparty=="WI-D"

tab stateparty personalfunds 

**# Table SI-1
use "workingdata.dta", clear

tab age
tab female
tab edu
tab race_cat, m

**# Table SI-2
use "workingdata.dta", clear

xi: reg cand1_money i.age i.female i.edu2 i.race_cat
xi: reg personalmoney i.age i.female i.edu2 i.race_cat

**# Table SI-3
use "workingdata.dta", clear

reg electability_dif cand1_grassroots personalmoney 
reg electability_dif cand1_money personalmoney 
reg electability_dif cand1_grassroots cand1_money 

**# Table SI-4a
use "workingdata.dta", clear

keep if primaryvoter==1
reg electability_dif cand1_money personalmoney 
reg electability_dif cand1_money personalmoney if pid3==1
reg electability_dif cand1_money personalmoney if pid3==2
reg electability_dif cand1_money personalmoney if pid3==3

**# Table SI-4b
use "workingdata.dta", clear

keep if primary_regular==1
reg electability_dif cand1_money personalmoney 
reg electability_dif cand1_money personalmoney if pid3==1
reg electability_dif cand1_money personalmoney if pid3==2
reg electability_dif cand1_money personalmoney if pid3==3

**# Table SI-5
use "workingdata.dta", clear

reg electability_dif cand1_money personalmoney i.edu2 i.race_cat i.gender i.age2 i.income2
reg electability_dif cand1_money personalmoney i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==1
reg electability_dif cand1_money personalmoney i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==2
reg electability_dif cand1_money personalmoney i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==3

**# Table SI-6
use "workingdata.dta", clear

reg electability_dif cand1_money percent_self i.edu2 i.race_cat i.gender i.age2 i.income2
reg electability_dif cand1_money percent_self i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==1
reg electability_dif cand1_money percent_self i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==2 
reg electability_dif cand1_money percent_self i.edu2 i.race_cat i.gender i.age2 i.income2 if pid3==3
